home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
TCL1
/
CSPINNER
/
SPINDEMO.C
< prev
Wrap
C/C++ Source or Header
|
1990-12-20
|
1KB
|
49 lines
/*
Sample program to demonstrate the use of the CSpinner class
*/
#include "CSpinner.h"
#include <oops.h>
main()
{
register CSpinner *theSpinner;
register short i;
long ticks;
InitGraf(&thePort); /* Standard initialization calls */
InitFonts();
InitWindows();
InitMenus();
TEInit();
InitDialogs(0L);
InitCursor(); /* Start out with arrow cursor */
/* Spinner. Threshold = 1 second */
/* Interval = 0.1 seconds */
theSpinner = new(CSpinner);
theSpinner->ISpinner(1000, 60, 6);
for (i = 0; i < 50; i++) { /* Spin cursor for a while */
theSpinner->Spin();
Delay(3, &ticks);
}
/* Set new delays: Threshold = 1/2 sec */
/* Interval = 1/60 sec */
theSpinner->SetTimes(30, 1);
theSpinner->Reset(); /* Reinitialize spin counters */
for (i = 0; i < 50; i++) { /* Spin cursor for a while */
theSpinner->Spin();
Delay(3, &ticks); /* Loop takes 3/60 of a second, which */
/* is greater than the spin interval, */
/* so cursor will spin every pass */
/* thru the loop. */
}
theSpinner->Dispose(); /* Get rid of Spinner object */
}